/*****************************************************************************
 * plum_api.h
 *
 * Copyright (C) 2020 Jeasonvor <1101627719@qq.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 ****************************************************************************/

#ifndef __PLUM_API_H__
#define __PLUM_API_H__

/*****************************************************************************
 * Included Files
 ****************************************************************************/

#define PLUM_API_INCLUDE

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <stddef.h>
#include <time.h>
#include <stdbool.h>

/** kernel */
#include "kernel/include/plum_kernel_api.h"

/** kal */
#include "kal/include/plum_kal_api.h"

/** hal */
#if (CONFIG_PLUM_HAL_ENABLE)
#include "hal/include/plum_hal_api.h"
#endif

/** cal */
#if (CONFIG_PLUM_CAL_ENABLE)
#include "cal/plum_cal_api.h"
#endif

#if (CONFIG_PLUM_THIRDPARTY_ENABLE)
#include "thirdparty/plum_thirdparty_api.h"
#endif

#if (CONFIG_PLUM_DRIVER_ENABLE)
#include "hardware/plum_device_api.h"
#endif

/*****************************************************************************
 * Pre-processor Definitions
 ****************************************************************************/

/*****************************************************************************
 * Public Types
 ****************************************************************************/

/*****************************************************************************
 * Public Data
 ****************************************************************************/

/****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
 * Public Function Prototypes
 ****************************************************************************/

PLUM_STATIC_INLINE
plum_void plum_init(plum_void)
{
    /** steps_1: 显示plum内核LOGO */
    plum_kernel_show_logo();

    /** steps_2: 外设驱动初始化 */

    /** steps_3: 设备驱动初始化 */
    plum_hal_device_init();

    /** steps_4: 命令行工具初始化 */
#if defined(CONFIG_CAL_CLI_ENABLE)
    plum_shell_init(getchar);
#endif
}

/****************************************************************************/
#ifdef __cplusplus
}
#endif
/****************************************************************************/
#endif /* __PLUM_API_H__ */
/****************************************************************************/

/****************************************************************************/
/*                                                                          */
/*  End of file.                                                            */
/*                                                                          */
/****************************************************************************/
